import request from '@/utils/request'

// 查询活动奖品
export function getActivityReward() {
  return request({
    url: `/admin/activity/list`,
    method: 'post'
  })
}
// 设置活动暂停和启动/admin/activity/update/status
export function updateActivityRewardStatus(data) {
  return request({
    url: `/admin/activity/update/status?activityId=${data.activityId}&status=${data.status}`,
    method: 'post'
  })
}
// 编辑活动详情/admin/activity/reward/getById
export function getActivityRewardById(data) {
  return request({
    url: `/admin/activity/getById?activityId=${data.activityId}`,
    method: 'post'
  })
}
// 新增大奖 post /admin/activity/reward/addBigReward
export function addOrUpdateBigReward(data) {
  return request({
    url: `/admin/activity/reward/addBigReward`,
    method: 'post',
    data: data
  })
}
// 设置中奖上限/admin/activity/update/dayMaxRewardCount
export function updateDayMaxRewardCount(data) {
  return request({
    url: `/admin/activity/update/dayMaxRewardCount?activityId=${data.activityId}&dayMaxRewardCount=${data.dayMaxRewardCount}`,
    method: 'post'
  })
}
// 取消大奖/admin/activity/reward/cancelBigReward
export function cancelBigRewards(data) {
  return request({
    url: `/admin/activity/reward/cancelBigReward?rewardId=${data.rewardId}`,
    method: 'post'
  })
}
// 大奖投放/admin/activity/reward/generateBigReward
export function generateBigRewards(data) {
  return request({
    url: `/admin/activity/reward/generateBigReward?rewardId=${data.rewardId}`,
    method: 'post'
  })
}
// 大奖省市区admin/address/getList?parentId=&level=
export function getAddressList(data) {
  return request({
    url: `/admin/address/getList?parentId=${data.parentId}`,
    method: 'post'
  })
}
// 新增活动规则/admin/activity/reward/rule/add
export function addActivityRewardRule(data) {
  return request({
    url: `/admin/activity/reward/rule/add`,
    method: 'post',
    data: data
  })
}
// 编辑活动规则/admin/activity/reward/rule/updateRuleGroup
export function updateRuleGroup(data) {
  return request({
    url: `/admin/activity/reward/rule/updateRuleGroup`,
    method: 'post',
    data: data
  })
}
// 新增活动/admin/activity/add
export function addActivity(data) {
  return request({
    url: `/admin/activity/add`,
    method: 'post',
    data: data
  })
}
// 抽奖次数列表/admin/activity/dict/getRewardRuleDrawTime
export function getRewardRuleDrawTime() {
  return request({
    url: `/admin/activity/dict/getRewardRuleDrawTime`,
    method: 'post'
  })
}
